package com.atguigu.jxc.dao;

import com.atguigu.jxc.entity.Goods;
import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * @description 商品信息
 */
public interface GoodsDao {


    String getMaxCode();


    Page<Goods>  getListInventory(@Param("codeOrName") String codeOrName, @Param("goodsTypeId") Integer goodsTypeId);

    Page<Goods> getList(@Param("goodsName") String goodsName, @Param("goodsTypeId") Integer goodsTypeId);

    void save(Goods goods);

    void update(@Param("goods") Goods goods, @Param("goodsId") Integer goodsId);

    Goods getStatus(Integer goodsId);

    int delete(Integer goodsId);

    Page<Goods> getNoInventoryQuantity(@Param("nameOrCode") String nameOrCode);

    Page<Goods> getHasInventoryQuantity(@Param("nameOrCode") String nameOrCode);

    void saveStock(@Param("goodsId") Integer goodsId, @Param("inventoryQuantity") Integer inventoryQuantity, @Param("purchasingPrice") double purchasingPrice);

    int deleteStock(@Param("goodsId") Integer goodsId);

    List<Goods> listAlarm();
}
